//
//  GHSuperTool.swift
//  GHSwiftProject
//
//  Created by Guanghui Liao on 4/6/18.
//  Copyright © 2018 liaoworking. All rights reserved.
//

import UIKit
import Alamofire

///// 是否是debug
//let isDebug: Bool = {
//    var isDebug = false
//    // function with a side effect and Bool return value that we can pass into assert()
//    func set(debug: Bool) -> Bool {
//        isDebug = debug
//        return isDebug
//    }
//    // assert:
//    // "Condition is only evaluated in playgrounds and -Onone builds."
//    // so isDebug is never changed to true in Release builds
//    assert(set(debug: true))
//    return isDebug
//}()


/// 网络是否连接
//var isNetworkConnect: Bool = {
//    let network = NetworkReachabilityManager()
//    return network?.isReachable ?? true //无返回就默认网络已连接
//}()

/// 是否是手机号
public func isPhoneNum(str:String)-> Bool{
    if str.isEmpty {
        return false
    }
    if (str.count != 11) || !(str.hasPrefix("1")) {
        return false
    }
    return true
}

/// 是否是纯数字
func isPureNumandCharacters(str: String?) -> Bool {
    
    if (str?.isEmpty)! {
        return false
    }
    let string = str!.trimmingCharacters(in: NSCharacterSet.decimalDigits)
    
    if  string.isEmpty{
        return true
    }
    return false
}



